import packageAxios from '../request';
const axios = packageAxios.instance;
const apiVersion = '/api/v1/profile/';

const userApi = {
    login (params) {
        return axios.post(apiVersion + 'login', params);
    },
    register (params) {
        return axios.post(apiVersion + 'register', params);
    },
    getCode (params) {
        return axios.get(apiVersion + 'getMessageCode', { params });
    },
    updateUserInfo (params) {
        return axios.put(apiVersion, params);
    },
    avatar (formData) {
        return axios(formData);
    },
    getUserInfo (params) {
        return axios.get(apiVersion, { params });
    },
    getMoney (params) {
        return axios.get(apiVersion + 'money', { params });
    }
};

export default userApi;
